package org.itsolutions.javaBackup.exceptions;

import java.util.UUID;


/**
 * OpenOEMS general problem.
 * @author Tomas Fecko
 */
public abstract class AException extends Exception {
	
	private static final long 	serialVersionUID = 6725414954085111869L;
	private String 				mExceptionUID = UUID.randomUUID().toString();
	
	/**
	 * 
	 */
	public AException() {
		super();
	}

	/**
	 * 
	 * @param pStr message 
	 * @param pCause cause
	 */
	public AException(String pStr, Throwable pCause) {
		super(pStr, pCause);
	}

	/**
	 * 
	 * @param pStr message
	 */
	public AException(String pStr) {
		super(pStr);
	}

	/**
	 * 
	 * @param pCause throwable
	 */
	public AException(Throwable pCause) {
		super(pCause);
	}

	//CHECKSTYLE:OFF generated methods
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;		
		result = prime * result + ((mExceptionUID == null) ? 0 : mExceptionUID.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object pObj) {
		if (this == pObj) {
			return true;
		}
		if (pObj == null) {
			return false;
		}
		if (!(pObj instanceof AException)) {
			return false;
		}
		AException other = (AException) pObj;
		if (mExceptionUID == null) {
			if (other.mExceptionUID != null) {
				return false;
			}
		} else if (!mExceptionUID.equals(other.mExceptionUID)) {
			return false;
		}
		return true;
	}
	//CHECKSTYLE:ON

}




